package org.marketlive.system.config;

import java.util.Locale;


/*
(C) Copyright MarketLive. 2006. All rights reserved.
MarketLive is a trademark of MarketLive, Inc.
Warning: This computer program is protected by copyright law and international treaties.
Unauthorized reproduction or distribution of this program, or any portion of it, may result
in severe civil and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.
*/

/**
 * Defines a tree representation of information about the environment in which
 * this configuration is being run. The tree is comprised of a root,
 * which contains branches. Each branch may contain sub-branches or a leaf.
 * Each leaf is associated with a datum that may be retrieved from the leaf.
 * Used by ConfigurationManager to load correct configuration tree with data from 
 * repositories that store data for multiple configurations.
 */
public interface IConfigurationContext {

    /**
     * Returns the JVM ID.  It is the application's responsibility
     * to ensure the JVM ID is unique within a given environment.
     * @return the JVM ID
     */
    String getVmId();

    /**
     * Returns the JVM type.  The types are typically "primary" and
     * "secondary," although others can be defined and used.
     * @return the JVM type
     */
    String getVmType();

    /**
     * Returns the host name the VM is run under.  This may be used to set
     * configuration variables that vary from machine to machine
     * within a single environment, such as the root path.
     *
     * @return the host name
     */
    String getHost();

    /**
     * Returns the environment type.  Typical values are dev, review, staging, production.
     * @return the environment type
     */
    String getEnvironment();

    /**
     * Returns the name of the client.
     * 
     * @return the name of the client
     */
    public String getClient();

    /**
     * Returns the locale for localized messages and formats.  This implementation uses
     * the JVM's default locale.
     *
     * @deprecated
     * Deprecated because an internationalized application needs to be
     * told by the presentation layer what Locale it wants. Unexpected results
     * may be returned if going directly to the platform layer.
     * There is no replacement at the platform layer, the locale should come from 
     * the presentation layer.
     *
     * @return the default JVM Locale
     */
    Locale getLocale();
}
